package org.example.config;

import cn.hutool.core.lang.Snowflake;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;

public class SnowflakeConfig {
    @Value("${dataCenterId}")
    private long dataCenterId;
    @Value("${workerId}")
    private long workerId;

    @Bean
    public Snowflake snowflake(){
        return new Snowflake(workerId, dataCenterId);
    }

}
